<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="template/base.xhtml">

    <ui:define name="content">
        <h:outputStylesheet library="css" name="movieDetails.css"/>
        <h:body>
            <h2 align="center">
                <h:outputFormat value="{0} - {1} minutes">
                    <f:param value="#{movieBean.movie.title}"/>
                    <f:param value="#{movieBean.movie.length}"/>
                </h:outputFormat>
            </h2>

            <h4 align="center">
                <h:outputFormat value="{0}">
                    <f:param value="#{movieBean.movie.description}"/>
                </h:outputFormat>
            </h4>
            <h:form>
                <h:dataTable id="dataTable" value="#{movieBean.showingTimes}" var="timeTable"
                             styleClass="cinemaTable"
                             headerClass="cinemaTableHeader"
                             rowClasses="cinemaTableOddRow,cinemaTableEvenRow">
                    <h:column>
                        <f:facet name="header">Available showing times</f:facet>
                        <h:commandLink id="showDetails" target="showDetails"
                                       onclick="window.open('','showDetails','status=no,toolbar=no,menubar=no,resizable,width=1200,height=800,left=340,top=120');"
                                       action="#{seatBean.process}">
                            <f:param name="roomId" value="#{timeTable.room.roomId}"/>
                            <f:param name="startTime" value="#{timeTable.startTime}"/>
                            <f:param name="timeTableID" value="#{timeTable.TId}"/>
                            <h:outputText value="#{timeTable.startTime}">
                                <f:convertDateTime
                                    pattern="yyyy/MM/dd HH:mm"/>
                            </h:outputText>
                        </h:commandLink>
                    </h:column>
                </h:dataTable>
                <br/>
            </h:form>
        </h:body>
    </ui:define>
</ui:composition>
</html>